Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rename candidate center id to registration center #4078

Merged

Conversation

cmadjar
Copy link
Collaborator

@cmadjar cmadjar commented Nov 8, 2018

Brief summary of changes

This PR rename the CenterID field column of the candidate table to RegistrationCenterID, which will correspond to the CenterID at which the candidate was first registered. This should never be changed for a given candidate. This is part 1 of the refactoring of the candidate's CenterID. (See #4058 for details on part 2 of the refactoring).

Associate LORIS-MRI PR

aces/Loris-MRI#341 (@nicolasbrossard will test it)

This resolves issue...

To test this change...

  • Make sure the following pages load and work as expected:

Notes for reviewers

I assigned above several people to test various parts of LORIS that were affected by the changes based on my knowledge of who worked on which module. Figured it would be less overwhelming if several people tested one part of the PR instead of having to test everything.

Note that since I don't have any genomics data or media and issue tracker set up, I could not test genomic browser, media or issue tracker.

@driusan @ridz1208 I was not sure who to assign the dashboard, new profile, candidate list, timepoint list, conflict resolvers and the tools. Maybe you can help filling the gap?

Notes for existing projects

  • RegistrationCenterID should never be changed for a given candidate. The session table will have the information about the latest CenterID the candidate has been seen.
  • Make sure that c.CenterID is replaced by c.RegistrationCenterID in your project code queries.

@cmadjar cmadjar added Release: Add to release notes PR whose changes should be highlighted in the release notes Cleanup PR or issue introducing/requiring at least one clean-up operation Release: Breaking changes PR that contains changes that might impact the code or accepted practices of active projects Language: SQL PR or issue that update SQL code Testing PR contains test plan or automated test code (or config files for Travis) Area: API PR or issue related to the API Release: Document at release PR whose changes need to be documented in the wiki (or other documentation) at release [branch] major labels Nov 8, 2018
@cmadjar cmadjar changed the base branch from minor to major November 8, 2018 14:35
@zaliqarosli
Copy link
Contributor

@cmadjar i'm trying to apply the patch and get the error Can't write; duplicate key in table. I can't spot anything wrong with the syntax but i'm assuming the FK isn't getting dropped properly?

@cmadjar
Copy link
Collaborator Author

cmadjar commented Nov 8, 2018

@zaliqarosli I modified the patch. I ran with the same issue but could never figure out why it failed when everything is done with one query. I just split the query in 3 statements and it worked for me. Give it a try. Thanks!!

@PapillonMcGill
Copy link
Contributor

@cmadjar @zaliqarosli When applying all 3 changes in a single command, the DB server commit only at the semi-column. Thus, when trying to change the column name, the FK is not yet drop, nor the when trying to add it back with the new column name.

Using 3 separate command (with auto-commit), ensure that the FK is first drop before renaming the column and the column is renamed before adding back the FK.

Check the code, look good with of course a few minor thing Travis pointed.

@cmadjar
Copy link
Collaborator Author

cmadjar commented Nov 12, 2018

@PapillonMcGill Thank you for the clarification. That makes a lot of sense!

@zaliqarosli
Copy link
Contributor

zaliqarosli commented Nov 12, 2018

@cmadjar could you rebase so changes to media module is included? there's a bug with hidden headers on this branch that was fixed on major. other than that, everything else looks good

@cmadjar cmadjar force-pushed the rename_candidate_CenterID_to_RegistrationCenterID branch from 40f41f9 to 54f739c Compare November 12, 2018 21:30
@cmadjar
Copy link
Collaborator Author

cmadjar commented Nov 12, 2018

@zaliqarosli rebased to the latest version of aces/major. Please review again when you can. Thanks!

modules/dashboard/php/dashboard.class.inc Show resolved Hide resolved
php/libraries/NDB_BVL_Feedback.class.inc Outdated Show resolved Hide resolved
php/libraries/NDB_BVL_Feedback.class.inc Outdated Show resolved Hide resolved
@PapillonMcGill PapillonMcGill dismissed their stale review November 16, 2018 17:40

change request superseeded

modules/candidate_list/php/candidate_list.class.inc Outdated Show resolved Hide resolved
modules/candidate_list/php/candidate_list.class.inc Outdated Show resolved Hide resolved
modules/candidate_list/php/candidate_list.class.inc Outdated Show resolved Hide resolved
php/libraries/NDB_BVL_Feedback.class.inc Outdated Show resolved Hide resolved
php/libraries/NDB_BVL_Feedback.class.inc Outdated Show resolved Hide resolved
Copy link
Collaborator Author

@cmadjar cmadjar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@zaliqarosli Thank you for your review!! All your comments should be taken care off. The only ones I did not change anything are for the genomic browser. I don't think genomic data is linked to a session but only to a candidate. @xlecours Is that right?

modules/candidate_list/php/candidate_list.class.inc Outdated Show resolved Hide resolved
modules/candidate_list/php/candidate_list.class.inc Outdated Show resolved Hide resolved
modules/candidate_list/php/candidate_list.class.inc Outdated Show resolved Hide resolved
php/libraries/NDB_BVL_Feedback.class.inc Outdated Show resolved Hide resolved
php/libraries/NDB_BVL_Feedback.class.inc Outdated Show resolved Hide resolved
zaliqarosli
zaliqarosli previously approved these changes Nov 19, 2018
@cmadjar
Copy link
Collaborator Author

cmadjar commented Nov 19, 2018

@zaliqarosli Sorry, I dismissed your review by merging @xlecours PR to my branch (I missed one instance of CenterID in the genomic module)

zaliqarosli
zaliqarosli previously approved these changes Nov 19, 2018
@xlecours
Copy link
Contributor

xlecours commented Nov 19, 2018

@cmadjar I concur. There is no session liked to genomic data; yet

PapillonMcGill
PapillonMcGill previously approved these changes Nov 20, 2018
@zaliqarosli zaliqarosli added the State: Needs rebase PR that needs to be rebased to proceed (conflicts, wrong branch...) label Nov 26, 2018
Copy link
Contributor

@kongtiaowang kongtiaowang left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

c.centerID should be c.RegistrationCenterID

@@ -246,7 +246,7 @@ class Mri_Violations extends \NDB_Menu_Filter_Form
AND mpvs.CandID = s.CandID
)
LEFT JOIN psc p
ON (p.CenterID = c.CenterID)
ON (p.CenterID = s.CenterID)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It should be " ON (p.CenterID = c. RegistrationCenterID)"

Copy link
Collaborator Author

@cmadjar cmadjar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@kongtiaowang actually I modified the join to join to the session CenterID in the queries you mentioned because I think it is best to use the CenterID of the session table here (s.CenterID) since a scan is linked to a session and the session's CenterID will be more informative about where the scans was performed than the CenterID from the candidate table if a candidate belongs to multiple sites.

I am not sure either this is why travis is failing. The Travis error is:

UnknownServerException: document.querySelector(...) is null
Build info: version: '2.53.1', revision: 'a36b8b1', time: '2016-06-30 17:37:03'
System info: host: '4e44a21cd803', ip: '172.18.0.2', os.name: 'Linux', os.arch: 'amd64', os.version: '4.4.0-101-generic', java.version: '1.8.0_91'
Driver info: driver.version: unknown
/app/vendor/facebook/webdriver/lib/WebDriverExceptions.php:79
/app/vendor/facebook/webdriver/lib/remote/HttpCommandExecutor.php:268
/app/vendor/facebook/webdriver/lib/remote/RemoteWebDriver.php:491
/app/vendor/facebook/webdriver/lib/remote/RemoteWebDriver.php:270
/app/modules/mri_violations/test/mri_violationsTest.php:538
/app/modules/mri_violations/test/mri_violationsTest.php:448

does not seem to be related with the renaming of the CenterID field. Does it? Not sure either why this means?

@cmadjar cmadjar added the "Help! I don't understand Travis!" PR is having a beef with TRAVIS. Someone needs to help label Jan 24, 2019
@ridz1208
Copy link
Collaborator

@kongtiaowang I agree with @cmadjar s.centerid makes more sens here

@ridz1208
Copy link
Collaborator

@cmadjar if you manually test MRI violations is everything working fine ?

thats where travis seems to be having issues

@cmadjar
Copy link
Collaborator Author

cmadjar commented Jan 25, 2019

@ridz1208 Indeed, the MRI violation module seems to work OK aside from what @nicolasbrossard reported which is a bug on major unrelated to my changes:

Fyi, from @nicolasbrossard : The MRI violations module loads and looks OK, except for a display bug in the MRI violations results table that existed prior to Cecile's PR. Approving.

@kongtiaowang kongtiaowang force-pushed the rename_candidate_CenterID_to_RegistrationCenterID branch from 0013677 to 28f3d96 Compare January 25, 2019 15:55
@cmadjar cmadjar force-pushed the rename_candidate_CenterID_to_RegistrationCenterID branch from 28f3d96 to 0013677 Compare January 25, 2019 17:34
@ridz1208
Copy link
Collaborator

ridz1208 commented Jan 25, 2019

@cmadjar
Parse error: syntax error, unexpected ';', expecting ')' in /app/modules/mri_violations/test/mri_violationsTest.php on line 90

EDIT: I fixed it directly on github

@cmadjar
Copy link
Collaborator Author

cmadjar commented Jan 25, 2019

@PapillonMcGill @zaliqarosli @nicolasbrossard @ridz1208 @xlecours A force push deleted your approval review. Could you look at that PR one last time? Thanks!

@kongtiaowang kongtiaowang removed the "Help! I don't understand Travis!" PR is having a beef with TRAVIS. Someone needs to help label Jan 25, 2019
@zaliqarosli
Copy link
Contributor

@cmadjar i'm getting a lot of issues with the issue tracker :( so i'm going to properly test again

@driusan
Copy link
Collaborator

driusan commented Jan 28, 2019

@cmadjar is this good to go already??

@cmadjar
Copy link
Collaborator Author

cmadjar commented Jan 28, 2019

@driusan yes pretty please :). This way I can start working on phase 2 this week!

@driusan driusan merged commit cfb46c7 into aces:major Jan 28, 2019
@cmadjar cmadjar deleted the rename_candidate_CenterID_to_RegistrationCenterID branch January 30, 2019 20:33
@ridz1208 ridz1208 added this to the 21.0.0 milestone Feb 11, 2019
driusan pushed a commit that referenced this pull request Sep 19, 2019
…rojectID to c.RegistrationProjectID (#4919)

This does 3 related changes to add user projects to LORIS:

1. Add the ProjectID field to sessions in the same manner as centers are affiliated to sessions for future development of project permissions
2. Change the candidate.ProjectID to candidate.RegistrationProjectID to remain consistent with the centerID changes done in #4078
3. Add necessary foreign keys to the SQL and fix existing fields to support the foreign keys from all tables.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: API PR or issue related to the API Cleanup PR or issue introducing/requiring at least one clean-up operation Language: SQL PR or issue that update SQL code Release: Add to release notes PR whose changes should be highlighted in the release notes Release: Breaking changes PR that contains changes that might impact the code or accepted practices of active projects Release: Document at release PR whose changes need to be documented in the wiki (or other documentation) at release Testing PR contains test plan or automated test code (or config files for Travis)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

10 participants